
package model.insert;

import model.insert.personinfo.PersonInfoInsertion;

import org.hibernate.Session;
import org.hibernate.Transaction;

import com.e885.hibernate.HibernateSessionFactory;

/**
 * SampleProject 依 project name 不同而改名, 新增全部的測試資料
 * 
 * @author Eric.Kao(gau168.gau@msa.hinet.net)
 * @version 1.0
 * @company E885 Group
 * @copyright Copyright (c) 2001-2008
 */

public class SampleProjectInsertion
{

	/**
	 * @param args
	 */
	public static void main( String[] args )
	{
		new SampleProjectInsertion();
	}

	public SampleProjectInsertion()
	{
		Session session;
		Transaction tx;
		try
		{
			session = HibernateSessionFactory.getSession();
			tx = session.beginTransaction();

			// Table PERSON_INFO
			insertPersonInfo( session );

			tx.commit();
		}
		finally
		{
			HibernateSessionFactory.closeSession();

			tx = null;
			session = null;
		}
	}

	private void insertPersonInfo( Session session )
	{
		PersonInfoInsertion insertion = new PersonInfoInsertion( 300 );

		insertion.insertTestData( session );
	}
}
